#if !defined(AFX_LABELEX_H__C9BE230C_B8E9_48DE_8022_F3D4F5260B65__INCLUDED_)
#define AFX_LABELEX_H__C9BE230C_B8E9_48DE_8022_F3D4F5260B65__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// LabelEx.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// CLabelEx window
#include <vector>
#include <string>

using namespace std;

class CLabelEx : public CStatic
{
public:
	CLabelEx();
	DECLARE_SERIAL(CLabelEx)
// Attributes

public:
	void SetBkColor(COLORREF crBkColor);
	void SetBorder(BOOL bBorder,COLORREF crBorder);
	void SetTextColor(COLORREF crText);
	virtual ~CLabelEx();

public:
	virtual BOOL PreTranslateMessage(MSG* pMsg);
	virtual void Serialize(CArchive& ar);
public:
	int			m_nUniqueId;
	int			m_x;
	int			m_xSpan;
	int			m_y;
	int			m_ySpan;
	CString	m_strTitle;
	CString m_strSizeId;
	CString	m_strIsTitle;
	vector<string>	  m_vecAreas;
	CRect	m_rect;

	CString		m_strMianId;
	CString		m_strPageFlag;
	BOOL		m_bVisible;
private:
	BOOL m_bBorder;
	COLORREF m_crText,m_crBorder,m_crBG;
	COLORREF m_crBackText;

	CRect	m_oldRect;

public:
	BOOL IsTransparent() { return m_bTranparent; }
	void SetTransparent(BOOL bTransparent=TRUE) { m_bTranparent = bTransparent;	}
	BOOL IsHovering() { return m_bHover; }
	BOOL IsMoveable() { return m_bAllowMove; }
	void SetMoveable(BOOL moveAble = TRUE) { m_bAllowMove = moveAble; }
	void SetToolTipText(CString spText, BOOL bActivate = TRUE);
	void SetToolTipText(UINT nId, BOOL bActivate = TRUE);
	void DeleteToolTip();
	CString GetWindowName() { return  m_windowName;	}//These are strictly to allow easy identification during Serialization
	void SetWindowName(CString szName) { m_windowName = szName;	}
	
	void  SetRect( CRect rect);
	CRect  GetRect( void);
	void ReplaceSelf( );
	// Generated message map functions
protected:
	BOOL m_bResizing;
	BOOL m_bTracking;
	BOOL m_bHover;
	BOOL m_bAllowMove;
	BOOL m_bTranparent;
	CPoint m_point;
	CRectTracker *m_track;
	CString m_windowName;
	void ActivateTooltip(BOOL bActivate = TRUE);
	CString m_tooltext;
	CToolTipCtrl* m_ToolTip;
	void InitToolTip();
	TCHAR *LongToStr(TCHAR *ch,long value)
	{
		_stprintf(ch,_T("%i"),value);
		return ch;
	}
protected:
	//{{AFX_MSG(CLabelEx)
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	afx_msg LRESULT OnMouseLeave(WPARAM wparam, LPARAM lparam);
	afx_msg LRESULT OnMouseHover(WPARAM wparam, LPARAM lparam);
	afx_msg void OnLButtonDown( UINT nFlags, CPoint point );
	afx_msg void OnLButtonUp( UINT nFlags, CPoint point );
	afx_msg void OnMove(int x, int y);
	afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
	afx_msg void OnPaint();
	afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
		
public:
	afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_LABELEX_H__C9BE230C_B8E9_48DE_8022_F3D4F5260B65__INCLUDED_)
